<#macro saveXmEdit>
<style>
.xmAcountEdit-container{
    border-radius: 3px;
    -moz-border-radius: 5px;
    background-clip: padding-box;
    width: 694px;
    height: 449px;
    background: #fff;
    border: 1px solid #eaeaea;
    position: absolute;
    top: 50px;
    left: 30%;
    z-index: 1000;
}
.xmAcountEdit-container .title {
    border-radius: 3px 3px 0px 0px;
    font-family: 微软雅黑;
    font-weight: 500;
    font-size: 20px;
    color: #fff;
    height: 50px;
    background-color: #1C6DC9;
}
.xmAcountEdit-container .title span{
    margin-left: 34px;
    position: absolute;
    top: 15px;
}
.xmAcountEdit-container .title .close{
    margin-left: 634px;
    margin-top: -5px;
    cursor: pointer;
}
.xmAcountEdit-container  .el-input__inner {
    background-color: #fff;
    background-image: none;
    border-bottom: 1px solid #d7e5ea;
    color: #1f2d3d;
    height: 35px;
    float: left;
    padding-left: 10px;
    width: 250px;
    font-size: 15px; 
}
.xmAcountEdit-container table td label.text_lab {
    font-size: 15px;
    text-align: right;
    padding-right: 24px;
    float: right;
}
.xmAcountEdit-container .el-button {
    border: 1px solid #bfcbd9;
    color: #fff;
    background-color: #1C6DC9;
    border-color: #1C6DC9;
    margin-right: 41%;
    cursor: pointer;
    width: 102px;
    height: 40px;
    float: right;
    margin-top: 20px;
    border-radius: 5px;
}

.xmAcountEdit-container table td span {
    float: left;
    margin-left: 20px;
    padding-top: 10px;
    color:red;
}
.xmAcountEdit-container table td p {
	font-size: 15px;
	padding-top: 10px;
    color: red;
}

.xmAcountEdit-container table td {
	width: 60px;
}
    
.searchBox {
    background-color: #fff;
    background-image: none;
    border: 1px solid #d9d9d9;
    color: #1f2d3d;
    height: 35px;
    float: left;
    padding-left: 10px;
    width: 260px;
    font-size: 15px;
    border-radius: 5px;
}
</style>
<div id="cntent_acount" style="display: none;">
<form  class="xmAcountEdit-container" id="csAcount">
	<input name="status" type="hidden" value="1"/>
	<input name="matchProjectId" type="hidden" value="${matchProject.id!}" />
	<input name="id" type="hidden" value="" />
	<input name="companyName" type="hidden" class="el-input__inner" value="${(user.extInfo['matchUser'].companyName)!}" readonly="readonly" />
	<h3  class="title">
	 	<span>编辑</span>
	 	<span class="close"><img src="static/cms/www/default/img/sshd/close.png" onclick="addDivShowWindow('cntent_acount')" /></span>
	</h3>
	<table style="width: 100%; height: 300px; background-color: fff;">
	  <tr>
	    <td><span>*</span><label class="text_lab" style="padding-top: 10px;">用户名:</label></td>
	    <td style="padding-top: 20px;"><input name="loginName" type="text" class="el-input__inner" required/>
	    <p>以“学校五位数代码+英文字符”规则进行命名</p>
	    </td>
	  </tr>
	  <tr>
	    <td class="text_t"><span>*</span><label class="text_lab">密码:</label></td>
	    <td class="text_t">
	   	<input type="text" name="password" class="el-input__inner"></td>
	  </tr>
	   <tr>
	    <td class="text_t"><span>*</span><label class="text_lab">姓名:</label></td>
	    <td class="text_t">
	   	<input type="text" name="name" class="el-input__inner"></td>
	  </tr>
	   <tr>
	    <td class="text_t"><label class="text_lab">性别:</label></td>
	    <td class="text_t">
	    	<select  class="searchBox"  name="sex">
				<#list sexList as data>
  				<option value ="${data.value!}">${data.name!}</option>
				</#list>  
			</select>
	  </tr>
	   <tr>
	    <td class="text_t"><label class="text_lab">职位:</label></td>
	    <td class="text_t"><input type="text" name="accountPost" class="el-input__inner"></td>
	  </tr>
	   <tr>
	    <td class="text_t"><label class="text_lab">邮箱:</label></td>
	    <td class="text_t"><input type="text" name="accountEmail" class="el-input__inner"></td>
	  </tr>
	   <tr>
	    <td class="text_t"><label class="text_lab">联系电话:</label></td>
	    <td class="text_t"><input type="text" name="accountTel" class="el-input__inner"></td>
	  </tr>
	</table>
	<div  class="el-form-item" style="width: 100%;">
		<div class="el-form-item__content" style="margin-left: 0px;">
			<button  type="submit" id="btn_select" class="el-button"><span style="font-size: 16px;">确&nbsp;认</span></button>
		</div>
	</div>
</form>
</div>
<script type="text/javascript">
function addDivShowWindow (id) {
	LayerShowWindow(id);
	$("#csAcount").validate().resetForm();
	$("#csAcount input").each(function(){
		if(this.name != "matchProjectId" && this.name != "status" && this.name != "companyName") {
				this.value = "";
		 }
	});	
}

function addTeamInfo(formId)
{
	$.ajax({
		type: 'POST',
		url: "matchManager.do?saveMatchAccount",
		dataType : 'json',  
		data: $("#" + formId).serialize(),
		success: function(data) {
           	  alertMessage(data,true,null);
		 },
        error:function(data,textstatus){
          	 errorMessage();
          }  
	});
}
$().ready(function() {
// 在键盘按下并释放及提交后验证提交表单
  $("#csAcount").validate({
  	debug:true,
    rules: {
      loginName:{required: true,numOrLetter:true},
      password: {required: true},
      name: {required: true},
      accountEmail:{email:true}
    },
    messages: {
      password: "请输入密码"
    },
    submitHandler: function(form){
    	 addTeamInfo('csAcount');
    }
  });
});
$.validator.addMethod("numOrLetter",function(value,element,params){
	var b = /^[0-9a-zA-Z]*$/g;
	return b.test(value);
},"必须是字母和数字！");
</script>

</#macro>